import React, { Component } from "react";
// import "./assets/css-reset.css";
import "./App.styl";
import { HashRouter, Route, Switch } from "react-router-dom";
import   '@/assets/css-reset.css'

// redux
import { Provider } from "react-redux";
import store from './redux/store'

import Login from "./containers/login/Login.jsx";
import Main from "./containers/main/Main.jsx";
import Register from "./containers/register/Register.jsx";

class App extends Component {
  render() {
    return (
      // provide用来将store注入到组件中
      <Provider store={store}>
     
        <HashRouter>
          
          {/* 项目主路由由三个组成  Switch组件用来渲染第一个匹配的路由 */}
          <Switch>
            {/* login路由登录 */}
            <Route path="/login" component={Login} />
            {/* 注册路由 */}
            <Route path="/register" component={Register} />
            {/* 主页路由 ， 如果上面都没匹配到那么到主页 */}
            <Route component={Main} />
          </Switch>
        </HashRouter>
      </Provider>
    );
  }
}

export default App;

